﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CloseAllWindows
{
    /// <summary>
    /// Interaction logic for ProcessItemControl.xaml
    /// </summary>
    public partial class ProcessItemControl : UserControl
    {
        public string GroupName = "";
        public int GroupIndex = -1;
        public ProcessItemControl()
        {
            InitializeComponent();
        }
        private void OnCheckedChange()
        {
            if (MainWindow.Instance.ProcessInfoDic.ContainsKey(GroupName))
            {
                MainWindow.Instance.ProcessInfoDic[GroupName][GroupIndex].isSelected = (bool)ItemCheck.IsChecked;
            }
        }
        private void ItemCheck_Checked(object sender, RoutedEventArgs e)
        {
            OnCheckedChange();
        }

        private void ItemCheck_UnChecked(object sender, RoutedEventArgs e)
        {
            OnCheckedChange();
        }
    }
}
